<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Album extends Model
{
    protected $fillable = ['property_id','category_id','images','status'];

    //所属分类
    public function category()
    {
        return $this->belongsTo('App\Models\Category');
    }

    // 所属楼盘
    public function property()
    {
        return $this->belongsTo('App\Models\Property');
    }

    public function getImagesAttribute($value)
    {
        return unserialize($value);
    }
}
